The present invention relates to a program executing method, system and program processing unit for a robot, and in particular, to a program executing method, system and program processing unit for a robot, which controls execution of programs according to its external environment and internal state.
Description of the Related Art
Conventionally, a robot control unit has been provided with security features to protect a robot and a user who operates the robot. There is described in Japanese Patent Application Laid-Open No. HEI11-77580 an example of the robot control unit having a built-in safety device. The robot control unit detects an overload in the operation of a robot, and stops a motor if the robot is overloaded. Herewith the robot control unit assures the safety of the operator as well as preventing damage when the robot collides with an outside machine.
However, the security features are completely incorporated as part of the robot control unit, and thus the entire robot control unit needs to be changed in case of any changes in the security features.
A robot control unit that solves the above problem in part is described in Japanese Patent Application Laid-Open No. HEI6-328379. The robot control unit is equipped with not security features but a motion correcting means for switching operation mode according to sensor information. FIG. 1(a) is a block diagram showing a configuration of the robot control unit. In the robot control unit, a condition monitoring section 822 decides a current operation state based on the information obtained through a sensor 84, and accordingly, an operation selecting section 823 switches operation mode by selecting one of operation correcting modules 8241 to 8243. The condition monitoring section 822 generates an event that indicates the current operation state based on the corresponding relation between a sensor value and an event value shown in FIG. 1(b). The operation selecting section 823 switches operation mode based on a state transition chart shown in FIG. 1(c). That is, when the sensor value f is less than or equal to a certain threshold F, event Ev1 is issued from the condition monitoring section 822. Subsequently, the operation selecting section 823 selects a running condition mode, and thus selects the operation correcting module of running condition. When the sensor value f is more than the threshold F, event Ev2 is issued from the condition monitoring section 822. In this case, the operation selecting section 823 selects a deburring condition mode, and the operation correcting module of deburring condition. The features of the safety device in the above-mentioned robot control unit can be implemented by using the motion correcting means. Moreover, since rules and modules for correcting operations are modularized, it is easy to modify security features compared to the above robot control unit.
In addition, there is a Java application environment as a program processing unit for a computer, although not for a robot. In document xe2x80x9cJava 2 Platform Security Architecturexe2x80x9d (Li Gong, Sun Microsystems), the latest Java technology, Java 2 security architecture, is described. According to the Java 2, it is possible to set limits to the object (file, network, etc.) and operation (reading, writing, etc.) of a program depending on the programmer and location of the program by rules called security policy. The security policy may be stored as a text file or binary data separately from the Java application environment. Therefore, the security policy alone can be changed without replacing the whole Java application environment.
However, in the security features of the conventional program processing unit, it is pointed out as the first problem that addition and modification of rules for restricting operations are difficult. This is because occurrence conditions of events that trigger state transition and rules for state transition are incorporated in the condition monitoring section and the operation selecting section, respectively, and only the rules cannot be simply changed. Besides, in the security features of the Java application environment, it is possible to modify the rules, but the rules concern about only programmers and locations. Additionally, there is no device or mechanism to use sensor information and the like.
The second problem is that in the security features of the conventional program processing unit, rules are poorly expressed and described. The description method or mechanism provided for the security features of the conventional robot control unit and also the Java application environment is too simple to describe the rule for synthetic judgment on the occasion of having a great deal of sensor and internal state information.
For example, a general-purpose robot is required to read programs from the outside and perform various operations. In such robot, it is necessary to test security through consolidating information about the programmer and location of a program, sensor information, and the internal state of the robot. Consequently, the robot needs a mechanism to describe rules for the security test by using the information in a comprehensive manner. Thus those inflexible in describing the rule such as the conventional robot control unit and the Java application environment are presumably inadequate.
It is therefore an object of the present invention to provide a program executing method and a program processing unit for a robot, in which execution of a program is controlled by using all available information such as the programmer and location of the program, sensor information and the internal state of a system to provide an operation mode suitable for execution environment of the program, and thus the safety of a robot and its operator is improved in execution of the program.
It is another object of the present invention to provide a program executing method and a program processing unit for a robot, in which, when execution of a program is controlled by using all available information such as the programmer and location of the program, sensor information and the internal state of a system, the safety in execution of the program is tested through consolidating many conditions, and the power of expressing and describing rules for the test is improved.
In accordance with the first aspect of the present invention, there is provided an robot program executing method comprising a command unit for issuing a command to a robot, a storage for storing information, an input unit for inputting information from the outside to the storage, a processing unit for executing a program, and an actuator that operates with a control signal from the processing unit, wherein: the processing unit includes a program processing unit for executing a program inputted from the outside; the program includes a command for actuating the actuator; the command may include one or more parameter(s) for designating the speed, distance and/or count; the storage includes at least an area for storing the program, an area for storing command rejection rules for rejecting execution of commands and/or command change rules for changing commands, and an area for storing source information of the program; the command rejection rule includes a command to be rejected and conditions for judging whether or not to reject the command; the command change rule includes a command to be replaced or modified, conditions for judging whether or not to change the command, and an alternative command; and the conditions may include conditions concerning the source information of the program, the command and parameter(s). In addition, for executing a command in the program, the robot program executing method comprises the steps of searching for a command rejection rule and/or command change rule corresponding to the command; if detected, retrieving the source information of the active program from the storage; judging conditions included in the command rejection rule and/or command change rule; dismissing the command or changing at least a part of the command when the conditions are satisfied; and executing the command when the conditions are not satisfied.
In accordance with the second aspect of the present invention, in the first aspect, the robot program executing method further comprises one or more sensor(s) for obtaining conditions outside the program processing unit and/or conditions of the unit itself, wherein the conditions may further include conditions concerning information inputted from the sensor(s). For executing a command in the program, the robot program executing method comprises the steps of: searching for a command rejection rule and/or command change rule corresponding to the command; if detected, retrieving the source information and sensor information; judging conditions included in the command rejection rule and/or command change rule using the information; dismissing the command or changing at least a part of the command when the conditions are satisfied; and executing the command when the conditions are not satisfied.
In accordance with the third aspect of the present invention, in the first and second aspects, the storage further includes an area for storing command execution history, wherein the conditions may further include conditions concerning the command execution history. For executing a command in the program, the robot program executing method comprises the steps of: searching for a command rejection rule and/or command change rule corresponding to the command; if detected, retrieving at least one selected from the source information, senor information and command execution history from the storage; judging conditions included in the command rejection rule and/or command change rule using the information; dismissing the command or changing at least a part of the command when the conditions are satisfied; and executing the command when the conditions are not satisfied.
In accordance with the fourth aspect of the present invention, there is provided an robot system comprising a command unit for issuing a command to a robot, a storage for storing information, an input unit for inputting information from the outside to the storage, a processing unit for executing a program, and an actuator that operates with a control signal from the processing unit, wherein: the processing unit includes a program processing unit for executing a program inputted from the outside; the program includes a command for the actuator; the command may include one or more parameter(s) for designating the speed, distance and/or count; the storage includes at least an area for storing the program, an area for storing command rejection rules for rejecting execution of commands and/or command change rules for changing commands, and an area for storing source information of the program; the command rejection rule includes a command to be rejected and conditions for judging whether or not to reject the command; the command change rule includes a command to be replaced or modified, conditions for judging whether or not to change the command, and an alternative command; and the conditions include at least one selected from conditions concerning source information of the program, the command and parameter(s). In addition, for executing a command in the program, the robot system searches for a command rejection rule and/or command change rule corresponding to the command; if detected, retrieves the source information of the active program from the storage; judges conditions included in the command rejection rule and/or command change rule based on the source information; dismisses the command or executes the alternative command in the command change rule when the conditions are satisfied; and executes the command when the conditions are not satisfied.
In accordance with the fifth aspect of the present invention, there is provided a program processing unit comprising a command unit for issuing a command to a robot, a storage for storing information, an input unit for inputting information from the outside to the storage, a processing unit for executing a program, and an actuator that operates with a control signal from the processing unit, wherein: the processing unit includes a program interpreter for reading a program from the storage and extracting commands; a command rejection means for judging whether or not to reject a command and dismissing the command when it is determined to be rejected, and/or command change means for judging whether or not to change a command and replacing at least a part of the command by an alternative command when it is determined to be changed; a command execution means for executing the command or alternative command. The command rejection means and/or command change means searches for a command rejection rule including at least conditions for judging whether or not to reject the command and/or command change rule including conditions for judging whether or not to change the command and the alternative command for replacing at least a part of the command corresponding to the command; if detected, retrieves source information of the active program from the storage; judges conditions included in the command rejection rule and/or command change rule using the source information; dismisses the command or sends the alternative command in the command change rule to the command execution means when the conditions are satisfied; and sends the command to the command execution means when the conditions are not satisfied.
In accordance with the sixth aspect of the present invention, in the fifth aspect, the program processing unit further comprises one or more sensor(s) for obtaining conditions outside the program processing unit and/or conditions of the unit itself. For executing a command in the program, the command rejection means and/or command change means searches for a command rejection rule and/or command change rule corresponding to the command, and if detected, retrieves the source information and input value from the sensor(s).
In accordance with the seventh aspect of the present invention, in the fifth and sixth aspects, the storage further includes an area for storing command execution history, wherein the command rejection means and/or command change means searches for a command rejection rule and/or command change rule corresponding to the command, and if detected, retrieves at least one selected from the source information, sensor information and corresponding command execution history.
In other words, a program processing unit according to the present invention determines whether or not to execute the command to actuate the actuator based on the input value from the sensor, the source information of the program and predetermined rules, and as a result, executes the command or dismisses it. More specifically, in the program processing unit, the command rejection means (FIG. 2, 12) obtains a command rejection rule (FIG. 2, 22) corresponding to a command sent from the program interpreter, judges rejection conditions of the rejection rule based on the input value from the sensor, the source information (FIG. 2, 23), the command and parameters of the command, dismisses the command when the rejection conditions are met, and sends the command to the command execution means when the conditions are not met.
Incidentally, the command rejection rule includes a command to be rejected and rejection conditions for determining whether or not to reject the command. The rejection conditions may include conditions concerning the parameter(s) of the command, the source information of the program, and the input value from the sensor.
In addition, the command rejection means searches for a command rejection rule corresponding to a command sent from the program interpreter, and when corresponding one is detected, retrieves the source information and the sensor input value for judging rejection conditions of the rejection rule. If the rejection conditions are met, the command is dismissed. If not, or no corresponding rule exists, the command is sent to the command execution means.
Another program processing unit according to the present invention determines whether or not to execute the command to actuate the actuator based on the command execution history, the source information of the program and predetermined rules, and as a result, executes the command or dismisses it. More specifically, in the program processing unit, the second command rejection means (FIG. 6, 122) obtains a second command rejection rule (FIG. 6, 222) corresponding to a command sent from the program interpreter, judges rejection conditions of the rejection rule based on the command execution history (FIG. 6, 24), the source information (FIG. 6, 23), the command and parameters of the command, dismisses the command when the rejection conditions are met, and sends the command to the command execution means when the conditions are not met.
Incidentally, the second command rejection rule includes a command to be rejected and rejection conditions for determining whether or not to reject the command. The rejection conditions may include conditions concerning the parameter(s) of the command, the source information of the program, and the command execution history.
In addition, the second command rejection means searches for a command rejection rule corresponding to a command sent from the program interpreter, and when corresponding one is detected, retrieves the source information and the command execution history for judging rejection conditions of the rejection rule. If the rejection conditions are met, the command is dismissed. If not, or no corresponding rule exists, the command is sent to the command execution means.
Another program processing unit according to the present invention determines whether or not to execute the command to actuate the actuator based on the input value from the sensor, the source information of the program and predetermined rules, and as a result, executes the command or an alternative command. More specifically, in the program processing unit, the command change means (FIG. 9, 14) obtains a command change rule (FIG. 9, 25) including a command to be changed, change conditions for determining whether or not to change the command, and an alternative command, judges the change conditions based on the input value from the sensor, the source information (FIG. 9, 23), the command and parameters of the command, sends the alternative command to the command execution means when the change conditions are met, and sends the command to the command execution means when the conditions are not met.
Incidentally, the command change rule includes a command to be changed, change conditions for determining whether or not to change the command, and an alternative command. The change conditions include the same conditions as the first command rejection rule.
In addition, the command change means searches for a command change rule corresponding to a command sent from the program interpreter, and when corresponding one is detected, retrieves the source information and the sensor input value for judging change conditions of the change rule. If the change conditions are met, the alternative command is executed. If not, or no corresponding rule exists, the command is sent to the command execution means.
Another program processing unit according to the present invention determines whether or not to execute the command to actuate the actuator based on the command execution history, the source information of the program and predetermined rules, and as a result, executes the command or an alternative command. More specifically, in the program processing unit, the second command change means obtains a second command change rule including a command to be changed, change conditions for determining whether or not to change the command, and an alternative command, judges the change conditions based on the command execution history, the source information, the command and parameters of the command, sends the alternative command to the command execution means when the change conditions are met, and sends the command to the command execution means when the conditions are not met.
Incidentally, the second command change rule includes a command to be changed, change conditions for determining whether or not to change the command, and an alternative command. The change conditions include the same conditions as the second command rejection rule.
In addition, the second command change means searches for a command change rule corresponding to a command sent from the program interpreter, and when corresponding one is detected, retrieves the source information and the command execution history for judging change conditions of the change rule. If the change conditions are met, the alternative command is executed. If not, or no corresponding rule exists, the command is sent to the command execution means.